package com.cloud.salon.common.base.vo.highcharts;

import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @Description highcharts基本图表VO
 * @Author wolf--LZH
 * @CreateDate 2019/5/15 0015 下午 3:15
 */
@Data
public class HighChartsVO {

    // 图表标题
    private TitleVO title;
    // 图表子标题
    private TitleVO subTitle;
    // 图表的x轴
    private AxisVO xAxis;
    // 图表的y轴
    private AxisVO yAxis;
    // 图表的y轴
    private AxisVO zAxis;
    // 图表数据列数据
    private List<Map<String, Object>> series;

    // 构造器
    public HighChartsVO() {
    }
    public HighChartsVO(TitleVO title) {
        this.title = title;
    }
    public HighChartsVO(TitleVO title, TitleVO subTitle) {
        this.title = title;
        this.subTitle = subTitle;
    }

    // 设置坐标轴
    public void setAxis(int type, String title, List<String> categories) {
        if (type == 3)
            this.zAxis = new AxisVO(title, categories);
        else if (type == 2)
            this.yAxis = new AxisVO(title, categories);
        else
            this.xAxis = new AxisVO(title, categories);
    }
}
